home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 August / Australian PC User - August 2003 (CD2).iso / software / online / files / netsnip.exe / %MAINDIR% / Templates / Bibliography / Bibliography (Chicago Style).xsl < prev    next >
Encoding:
Extensible Markup Language  |  2003-06-02  |  5.7 KB  |  203 lines

  1. <?xml version="1.0"?>
  2.  
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  4.  
  5.   <xsl:template match="/">
  6.  
  7.     <HTML>
  8.  
  9.     <head>
  10.  
  11.       <title>
  12.          <xsl:value-of select="Bibliography/FolderName"/> Bibliography (Chicago Style)
  13.       </title>
  14.     </head>
  15.  
  16.       <BODY>
  17.             
  18.     <table border="0" width="40%" cellspacing="0" cellpadding="2">
  19.       <tr><td>
  20.  
  21.            <b><font face="MS Sans Serif" size="2">
  22.              <xsl:value-of select="Bibliography/FolderName"/> Bibliography (Chicago Style)
  23.            </font></b>
  24.             <p/>
  25.       </td></tr>
  26.       
  27.       <tr><td>
  28.           <xsl:apply-templates select="Bibliography/FolderDetails"/>
  29.           <xsl:apply-templates select="Bibliography/SnippetDetails"/>
  30.       </td></tr>
  31.  
  32.   <tr>
  33.     <td><hr size="1"/><font face="MS Sans Serif" size="1">Chicago Style Bibliography Generated
  34.       by <a href="http://www.netsnippets.com">Net Snippets</a><sup>TM</sup></font></td>
  35.   </tr>
  36.  
  37.     </table>
  38.  
  39.       </BODY>
  40.     </HTML>
  41.  
  42.   </xsl:template>
  43.  
  44.  
  45.   <xsl:template match="FolderDetails">
  46.        <xsl:apply-templates select="FolderDetails"/>
  47.        <xsl:apply-templates select="SnippetDetails"/>
  48.  
  49.   </xsl:template>
  50.  
  51.  
  52.  
  53.   <xsl:template match="SnippetDetails">
  54.              
  55.  
  56.           <xsl:if test="/Bibliography/Settings/Biblio_Name">
  57.  
  58.         <b>
  59.                 <xsl:choose>
  60.                 <xsl:when test="/Bibliography/Settings/Biblio_LinkSnippet">
  61.                   <A>
  62.                     <xsl:attribute name="HREF"><xsl:value-of select="Path"/></xsl:attribute>
  63.                    <font size="1" face="MS Sans Serif">
  64.                     <xsl:value-of select="Name"/><xsl:value-of select="Extension"/> 
  65.                    </font> 
  66.                   </A>
  67.         </xsl:when> 
  68.                 
  69.             <xsl:otherwise>
  70.                    <font size="1" face="MS Sans Serif">
  71.                     <xsl:value-of select="Name"/><xsl:value-of select="Extension"/>
  72.                    </font> 
  73.                 </xsl:otherwise>
  74.         
  75.         </xsl:choose>
  76.         </b>
  77.  
  78.               </xsl:if> 
  79.            <br/>    
  80.                <font size="1" face="MS Sans Serif">
  81.    
  82.                <xsl:apply-templates select="Biblio" order-by="Authors"/>
  83.                </font>
  84.  
  85.   </xsl:template>
  86.  
  87.  
  88. <xsl:script><![CDATA[
  89.   Counter= 0;
  90.     
  91.   function GetCounter(n) {
  92.     Counter = Counter + 1;
  93.     return Counter;
  94.   }
  95.     
  96. ]]></xsl:script>
  97.  
  98.  
  99.   <xsl:template match="Biblio">
  100.     <xsl:eval>GetCounter(this)</xsl:eval>.
  101.     
  102.     <xsl:choose>
  103.  
  104.     <xsl:when test="Type[.='Web Site']">
  105.             <xsl:apply-templates select="Authors"/>
  106.             "<xsl:value-of select="Title"/>,"
  107.             <xsl:apply-templates select="Editors"/>
  108.             <xsl:apply-templates select="Date_Created"/>
  109.             <xsl:apply-templates select="URL"/>
  110.             <xsl:apply-templates select="Date_Accessed"/>
  111.     </xsl:when> 
  112.  
  113.     <xsl:when test="Type[.='Book']">
  114.             <xsl:apply-templates select="Authors"/>
  115.             "<xsl:value-of select="Title"/>,"
  116.             <xsl:apply-templates select="Editors"/>
  117.             <xsl:apply-templates select="Date_Created"/>
  118.             <xsl:apply-templates select="URL"/>
  119.             <xsl:apply-templates select="Date_Accessed"/>
  120.     </xsl:when> 
  121.  
  122.     <xsl:when test="Type[.='eJournal']">
  123.             <xsl:apply-templates select="Authors"/>
  124.             "<xsl:value-of select="Title"/>,"
  125.             <xsl:apply-templates select="Name"/>
  126.             <xsl:apply-templates select="Editors"/>
  127.             <xsl:apply-templates select="Date_Created"/>
  128.             <xsl:apply-templates select="URL"/>
  129.             <xsl:apply-templates select="Date_Accessed"/>
  130.     </xsl:when> 
  131.  
  132.  
  133.     <xsl:when test="Type[.='eZine']">
  134.             <xsl:apply-templates select="Authors"/>
  135.             "<xsl:value-of select="Title"/>,"
  136.             <xsl:apply-templates select="Name"/>
  137.             <xsl:apply-templates select="Editors"/>
  138.             <xsl:apply-templates select="Date_Created"/>
  139.             <xsl:apply-templates select="URL"/>
  140.             <xsl:apply-templates select="Date_Accessed"/>
  141.     </xsl:when> 
  142.  
  143.  
  144.     <xsl:when test="Type[.='Newspaper']">
  145.             <xsl:apply-templates select="Authors"/>
  146.             "<xsl:value-of select="Title"/>,"
  147.             <xsl:apply-templates select="Name"/>
  148.             <xsl:apply-templates select="Editors"/>
  149.             <xsl:apply-templates select="Date_Created"/>
  150.             <xsl:apply-templates select="URL"/>
  151.             <xsl:apply-templates select="Date_Accessed"/>
  152.     </xsl:when> 
  153.  
  154.     <xsl:otherwise>
  155.          <b><font color="#FF0000">Type not currently supported in Chicago Style</font>: <xsl:value-of select="Type"/></b><br/>
  156.  
  157.     </xsl:otherwise>
  158.  
  159.     </xsl:choose>
  160.     <p/>
  161.  
  162.  </xsl:template>  
  163.  
  164.   <xsl:template match="Authors">
  165.       <xsl:value-of select="."/>.
  166.   </xsl:template>  
  167.  
  168.   <xsl:template match="Compilers">
  169.       compiled by
  170.       <xsl:value-of select="."/>
  171.   </xsl:template>  
  172.  
  173.   <xsl:template match="Editors">
  174.       edited by
  175.       <xsl:value-of select="."/>.
  176.   </xsl:template>  
  177.  
  178.   <xsl:template match="Translators">
  179.       translated by
  180.       <xsl:value-of select="."/>.
  181.   </xsl:template>  
  182.  
  183.   <xsl:template match="Date_Created">
  184.       <xsl:value-of select="."/>,
  185.   </xsl:template>  
  186.  
  187.   <xsl:template match="Institution">
  188.       <xsl:value-of select="."/>.
  189.   </xsl:template>  
  190.  
  191.   <xsl:template match="Date_Accessed">
  192.       (<xsl:value-of select="."/>).
  193.   </xsl:template>  
  194.  
  195.   <xsl:template match="Name">
  196.       <i><xsl:value-of select="."/></i>.
  197.   </xsl:template>  
  198.  
  199.   <xsl:template match="URL">
  200.       <<A><xsl:attribute name="HREF"><xsl:value-of select="."/></xsl:attribute><xsl:value-of select="."/></A>>
  201.   </xsl:template>  
  202.  
  203. </xsl:stylesheet>